var fs = require('fs');

var zlib = require('zlib');

// compress a.txt to a.gz
fs.createReadStream('a.txt').pipe(zlib.createGzip()).pipe(fs.createWriteStream('a.gz'));

// uncompress a.gz
fs.createReadStream('a.gz').pipe(zlib.createGunzip()).pipe(fs.createWriteStream('a.txt'));

console.log('end');


